#ifndef SIMULATOR_H
#define SIMULATOR_H

#include <vector>
#include "makefile_deps.h"
#include "deps.h"
#include "TThreadPool.hh"
#include "TThread.hh"

using ThreadPool::TPool;

class Simulator 
{
	unsigned int maxJobs;
protected:
	TPool *pool;
public:
	Simulator() : maxJobs(1) {
		pool = new TPool(1);
	}
	Simulator(int mJ) : maxJobs(mJ) {
		pool = new TPool(mJ);
	}
	virtual ~Simulator() {
		delete pool;
	}
	virtual void start(MakefileDeps *) = 0;
private:
	Simulator& operator=(const Simulator&);
	Simulator(const Simulator&);
};

class BasicSimulator: public Simulator {
public:
	BasicSimulator(int mj) : Simulator(mj) {}
	virtual void start(MakefileDeps *);
};

class StaticSimulator: public Simulator {
public:
	StaticSimulator(int mj) : Simulator(mj) {}
        virtual void start(MakefileDeps *);
};

class TCompileJob : public TPool::TJob
{
public:
	void run(void *ptr);
};
#endif //SIMULATOR_H
